<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Navigator Browser</title>
  </head>
  <body>
    <p style="color:red;font-weight:900;">Navigator 对象属性：</p>
    <p id="info" style="bord:solid black 1px;"></p>
    <input type="button" name="" value="获取当前浏览器信息" onclick="navinfo();">
    <script>
          function $(id){ return document.getElementById(id);}
          function navinfo(){
            $('info').innerHTML="浏览器代号: " + navigator.appCodeName +"<br>浏览器版本: " + navigator.appVersion + "<br>浏览器名称: " + navigator.appName + "<br>硬件平台: " + navigator.platform +"<br>navigator.userAgent: " + navigator.userAgent ;
              alert("是否启用 Cookie: " + navigator.cookieEnabled);
              document.write("是否启用Java: " + navigator.javaEnabled() + "<br>是否启用数据污点: " + navigator.taintEnabled());
          }
    </script>
  </body>
</html>
